package com.qf.service.impl;

import com.qf.mapper.GoodsClassMapper;
import com.qf.pojo.GoodsClass;
import com.qf.service.ClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClassServiceImpl implements ClassService {

    @Autowired
    private GoodsClassMapper mapper;

    @Override
    public List<GoodsClass> findAllClass() {
        return mapper.selectByExample(null);
    }

    @Override
    public void addClass(GoodsClass goodsClass) {
        mapper.insertSelective(goodsClass);
    }

    @Override
    public void deleteClassById(Integer id) {
        mapper.deleteByPrimaryKey(id);
    }

    @Override
    public void updateClass(GoodsClass goodsClass) {
        mapper.updateByPrimaryKeySelective(goodsClass);
    }
}
